#include <stdio.h>
#include <malloc.h>
#include <assert.h>

#include "stack_draft.h"

int main()
{
double d = 0;
*(int*) &d = 0xBAD;
printf ("%lg\n", d);
printf ("%x\n", *(int*)&d);

int i = 0, assert_ver_val = 0, smth = 0;
elem_t x = 0;

Stack_t st = {};

/*Stack_construct (&st);
printf ("constructed stack:\nst.data[0] = %f\nst.count = %d\n", st.data[0], st.count);
printf ("Stack is OK = %d\n\n", Stack_OK (&st));

Stack_dump (&st);

x = Stack_pop (&st);
printf ("x = %f\n", x);

printf ("\n\n");
for (i = 0; i < STK_SZ - 1; i++)
	{
	assert_ver_val = Stack_push (&st, i + 1);
	assert (assert_ver_val);
	}
Stack_dump (&st);

printf ("\n\n");

x = Stack_pop (&st);
printf ("x = %f\n", x);
Stack_dump (&st);

x = Stack_pop (&st);
printf ("x = %f\n", x);
Stack_dump (&st);

Stack_destruct (&st);
printf ("destructed stack:\nst.data[0] = %f\nst.count = %d\n", st.data[0], st.count);
printf ("Stack is OK = %d\n\n", Stack_OK(&st));*/

Stack_construct (&st);

//x = Stack_pop (&st);

for (i = 0; i < 5/*STK_SZ*/; i++)
	{
	assert_ver_val = Stack_push (&st, i + 1);
	assert (assert_ver_val);
	}

Stack_dump (&st);

/*printf ("%f\n", Stack_pop (&st));

Stack_dump (&st);*/

smth = Stack_sum (&st);
assert (smth);
printf ("assert Stack_sum = %d\n", smth);
Stack_dump (&st);

smth = 0;

smth = Stack_sub (&st);
printf ("assert Stack_sub = %d\n", smth);
Stack_dump (&st);

smth = 0;

smth = Stack_mul (&st);
printf ("assert Stack_mul = %d\n", smth);
Stack_dump (&st);

smth = 0;

smth = Stack_div (&st);
printf ("assert Stack_div = %d\n", smth);
Stack_dump (&st);

smth = 0;

return 0;
}